package com.initSystem;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

import com.service.ICommissionerService;

//import com.push.SmackUtils;

/**
 * 通过设定value的值来指定执行顺序
 */
@Component
@Order(value = 1)
public class ApplicationInitSystem implements ApplicationRunner {

	@Autowired
	private ICommissionerService commissionerService;
	
	@Override
	public void run(ApplicationArguments args) throws Exception {
		if(ObjectUtils.isEmpty(commissionerService.findAdmin())){
			commissionerService.addAdmin();
		}
	}

}
